Shader "Unlit/Day16Shader2"
{
    properties
    {
        _mainColor("main Color",color) = (1,1,1,1)
        _mainTexture("main Texture",2D) ="white"{}
        [Toggle]_testToggle("test tToggle",float) = 0
    }
    
    subshader
    {
        Tags
        {
            "RenderPipeline" = "UniversalPipeline"
            "Queue" = "Geometry"
        }
        pass
        {
            Tags
            {
                "LightMode" = "UniversalForward"    
            }

            HLSLINCLUDE
                #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
                CBUFFER_START(UnityPerMaterial)
                half _testToggle;
                float4 _mainColor;
                TEXTURE2D(_mainTexture);
                SAMPLER(sampler_mainTexture);
                SamplerState MyRepeatPointSampler;
                float4 _mainTexture_ST;
                float _floatArray[4];
                vector _vectorArray[2];
                CBUFFER_END
            ENDHLSL
            //Cull Off
            //ZTest Always
            //ZWrite Off
            //Blend SrcColor OneMinusSrcColor
            HLSLPROGRAM
         
            #pragma vertex UnlitPassVert
            #pragma fragment UnlitPassFragment

            /*
            #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
            CBUFFER_START(UnityPerMaterial)
            float4 _mainColor;
            TEXTURE2D(_mainTexture);
            SAMPLER(sampler_mainTexture);
            CBUFFER_END
            */

            struct Attribute
            {
                float3 posOS:POSITION; // OS WS VS CS
                float2 uv:TEXCOORD0;
            };
            struct  Varying
            {
                float4 posCS:SV_POSITION;
                float2 uv:TEXCOORD0;

            };
            Varying UnlitPassVert(Attribute IN) 
            {
                Varying OUT = (Varying)0;
                OUT.posCS = mul(UNITY_MATRIX_MVP,float4(IN.posOS,1)) ;
                OUT.uv =TRANSFORM_TEX(IN.uv,_mainTexture);
                return OUT;
            }
            float4 UnlitPassFragment(Varying IN):SV_TARGET
            {
                const float4 mainTextureColor = SAMPLE_TEXTURE2D(_mainTexture,MyRepeatPointSampler,IN.uv);
                float3 rgb =(mainTextureColor*_mainColor).rgb;
                return _vectorArray[0];
            }
            ENDHLSL
        }
    }

    Fallback  "Hidden/Universal Render Pipeline/FallbackError"
}
